﻿using System;

namespace SDCloudSolution.SDCloud.Entities
{
    public class Paging
    {
        private readonly int _pageIndex;

        public int PageIndex
        {
            get { return _pageIndex; }
        }

        private readonly int _pageSize;
        public int PageSize
        {
            get { return _pageSize; }
        }

        public Paging(int pageIndex, int pageSize)
        {
            if (pageIndex < 0)
            {
                throw new ArgumentOutOfRangeException("pageIndex", "Should be a non negative.");
            }

            if (pageSize <= 0)
            {
                throw new ArgumentOutOfRangeException("pageSize", "Should be greater that zero.");
            }

            _pageIndex = pageIndex;
            _pageSize = pageSize;
        }
    }
}
